package javaCode.chapter07.Homework.homework05;

/*
设计父类——员工类。子类：工人类(worker)，农名类(Peasant)，教师类(Teacher)，科学家类(Scientist)，服务生类(Waiter)
1、其中工人，农民，服务生只有基本工资sal
2、教师除基本工资外，还有课酬(元/天) classDay，classSal
3、科学家除基本工资外，还有年终奖 bonus
4、编写一个测试类，将各种类型的员工的全年工资打印出来
 */
public class Employee {
    //分析出有一个带薪的月份
    private String name;
    private double sal;
    private int salMonth = 12;

    public Employee(String name, double sal) {
        this.name = name;
        this.sal = sal;
    }

    public int getSalMonth() {
        return salMonth;
    }

    public void setSalMonth(int salMonth) {
        this.salMonth = salMonth;
    }

    public void yearSal(){
        System.out.println(name + " 年薪=" + (salMonth * sal));
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSal() {
        return sal;
    }

    public void setSal(double sal) {
        this.sal = sal;
    }
}
